package com.mla.fastdfs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mla.fastdfs.mapper.RolePermissionMapper;
import com.mla.fastdfs.pojo.RolePermission;
import com.mla.fastdfs.service.RolePermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author Jun
 * @version v1.0
 * @date 2020-08-17
 */
@Service
public class RolePermissionServiceImpl extends ServiceImpl<RolePermissionMapper, RolePermission> implements RolePermissionService {

    @Autowired
    private RolePermissionMapper rolePermissionMapper;

    
    public void insert(RolePermission record) {
        rolePermissionMapper.insert(record);
    }

    
    public void update(RolePermission record){
        rolePermissionMapper.updateById(record);
    }

    
    public void del(Integer id){
        rolePermissionMapper.deleteById(id);
    }

    
    public RolePermission selectByPrimaryKey(Integer id){
        return rolePermissionMapper.selectByPrimaryKey(id);
    }

    
    public List<RolePermission> getList(RolePermission record){

        return rolePermissionMapper.selectByRecord(record);
    }

    
    public PageInfo<RolePermission> pageList(RolePermission record, Integer pageNo, Integer pageSize){
        PageHelper.startPage(pageNo, pageSize);
        List<RolePermission> list = rolePermissionMapper.selectByRecord(record);
        return new PageInfo<>(list);
    }

}